package com.hepinghospital.user.adapter

import android.annotation.SuppressLint
import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.hepinghospital.user.R
import com.hjq.shape.view.ShapeTextView
import com.rest.response.DrugResponse


class ReportReasonAdapter(data: MutableList<String>) : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_report_reason, data) {
    private var index = 0

    @SuppressLint("SetTextI18n")
    override fun convert(holder: BaseViewHolder, item: String) {
        if (index % 2 == 0) {
            holder.getView<ShapeTextView>(R.id.tv_reason).apply {
                visibility = View.VISIBLE
                holder.setGone(R.id.tv_reason1, true)
                index++
                text = item
            }
        } else {
            holder.getView<ShapeTextView>(R.id.tv_reason1).apply {
                visibility = View.VISIBLE
                holder.setGone(R.id.tv_reason, true)
                index++
                text = item
            }
        }
    }
}